package a.f.h.c;

import a.c.v;
import a.c.y;
import a.c.z;
import a.f.h.b.k;

import java.util.Comparator;

public class b
  implements g
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 2;
  private int d = 1;
  public static boolean e;
  
  public void a(int paramInt)
  {
    this.d = paramInt;
  }
  
  public int a()
  {
    return this.d;
  }
  
  public void a(a.f.h.b.f paramf, l paraml1, l paraml2)
  {
    boolean bool = d.o;
    int i1 = d.n;
    m localm = new m(paraml1, paraml2);
    localm.a(paramf);
    int i = 2147483647;
    int j = 0;
    int k = 1;
    int m = 0;
    int n = 1;
    if (n != 0)
    {
      n.a(this, "New Iteration: " + k);
      n = 0;
    }
    label226:
    while (bool)
    {
      if (!bool)
      {
        switch (k)
        {
        case 0: 
          j = 1;
          a(paramf, paraml1, k.b);
          m = m.a(paramf, paraml1, paraml2);
          if (!bool)
          {
            if (m < i) {
              n = 1;
            }
            i = m;
          }
          if (bool) {
            break label226;
          }
          if (i1 == 0) {
            break;
          }
        case 1: 
          j = 0;
          a(paramf, paraml2, k.c);
          m = m.a(paramf, paraml1, paraml2);
          if (!bool) {
            if (m < i) {
              n = 1;
            }
          }
          i = m;
        }
        k = j;
        n.a(this, "Total Edge Length: " + m);
      }
      if (i1 == 0) {
        break;
      }
    }
  }
  
  public void a(a.f.h.b.f paramf, l paraml, k paramk)
  {
    boolean bool = d.o;
    int i = d.n;
    paraml.c();
    z localz = a(paraml.f());
    y localy = localz.h();
    d_ locald_ = new d_(paraml);
    if (localy.e()) {}
    Object localObject1;
    Object localObject2;
    Object localObject3;
    label179:
    while (bool)
    {
      b_ localb_ = (b_)localy.j();
      if (i != 0) {
        break label272;
      }
      switch (localb_.c())
      {
      case 0: 
        localObject1 = localb_.d();
        localObject2 = locald_.a((d)localObject1);
        localObject3 = localObject2[0];
        d locald = localObject2[1];
        if (!bool) {
          if (localObject3 != null)
          {
            if (bool) {
              break label179;
            }
            if ((((d)localObject3).l() != ((d)localObject1).l()) && (!a(paramf, (d)localObject3, (d)localObject1))) {
              paraml.a((d)localObject3, (d)localObject1, 1);
            }
          }
        }
        if ((bool) || (locald != null))
        {
          if (bool) {
            break label260;
          }
          if (((d)localObject1).l() != locald.l())
          {
            if (bool) {
              break label260;
            }
            if (!a(paramf, (d)localObject1, locald))
            {
              paraml.a((d)localObject1, locald, 1);
              if (bool) {
                break label260;
              }
              if (i == 0) {
                break;
              }
            }
          }
        }
        break;
      case 1: 
        locald_.b(localb_.d());
      }
      localy.f();
      if (i == 0) {
        break;
      }
    }
    label260:
    switch (this.d)
    {
    case 0: 
      localObject1 = new f();
      ((f)localObject1).a(paraml);
      if (i == 0) {
        break;
      }
    case 1: 
      localObject2 = new e();
      ((e)localObject2).a(paraml);
      if (i == 0) {
        break;
      }
    case 2: 
      label272:
      localObject3 = new i();
      ((i)localObject3).a(true);
      ((i)localObject3).a(paraml);
    }
  }
  
  protected z a(y paramy)
  {
    boolean bool = d.o;
    int i = d.n;
    z localz = new z();
    if (paramy.e()) {}
    while (bool)
    {
      d locald = (d)paramy.j();
      b_ localb_1 = new b_(locald.g().l(), 0, locald);
      b_ localb_2 = new b_(locald.h().l(), 1, locald);
      localz.add(localb_1);
      if (bool) {
        break label128;
      }
      localz.add(localb_2);
      paramy.f();
      if (i != 0) {
        return localz;
      }
      if (i == 0) {
        break;
      }
    }
    localz.a(new a_());
    label128:
    return localz;
  }
  
  protected static boolean a(a.f.h.b.f paramf, d paramd1, d paramd2)
  {
    boolean bool = d.o;
    a.c.d locald;
    if (!bool) {
      if (paramd1.h() == paramd2.g())
      {
        locald = paramd1.j().a(paramd2.i());
        return locald != null;
      }
    }
    if ((bool) || (paramd2.h() == paramd1.g()))
    {
      locald = paramd2.j().a(paramd1.i());
      return locald != null;
    }
    return false;
  }
  
  static class d_
  {
    l a;
    z b = new z();
    
    d_(l paraml)
    {
      this.a = paraml;
    }
    
    public d[] a(d paramd)
    {
      boolean bool = d.o;
      int i = d.n;
      d[] arrayOfd = new d[2];
      arrayOfd[0] = null;
      arrayOfd[1] = null;
      v localv1 = this.b.f();
      v localv2 = null;
      do
      {
        do
        {
          if (localv1 == null) {
            break;
          }
          d locald = (d)this.b.g(localv1);
          if ((!bool) && (i != 0)) {
            break label113;
          }
          if (!bool)
          {
            if (locald.l() >= paramd.l()) {
              break;
            }
            localv2 = localv1;
            localv1 = this.b.c(localv1);
          }
        } while (i == 0);
      } while (bool);
      this.b.a(paramd, localv1);
      label113:
      if (!bool) {
        if (localv2 != null) {
          arrayOfd[0] = ((d)this.b.g(localv2));
        }
      }
      if (localv1 != null) {
        arrayOfd[1] = ((d)this.b.g(localv1));
      }
      return arrayOfd;
    }
    
    public void b(d paramd)
    {
      this.b.remove(paramd);
    }
  }
  
  public class a_
    implements Comparator
  {
    public static int a;
    
    public a_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = d.o;
      b.b_ localb_1 = (b.b_)paramObject1;
      b.b_ localb_2 = (b.b_)paramObject2;
      if (!bool) {
        if (localb_1.a() < localb_2.a()) {
          return -1;
        }
      }
      if (!bool) {
        if (localb_1.a() > localb_2.a()) {
          return 1;
        }
      }
      if (!bool) {
        if (localb_1.c() == 1)
        {
          if (bool) {
            break label88;
          }
          if (localb_2.c() == 0) {
            return 1;
          }
        }
      }
      label88:
      if (!bool) {
        if (localb_1.c() == 0)
        {
          if (bool) {
            break label127;
          }
          if (localb_2.c() == 1) {
            return -1;
          }
        }
      }
      label127:
      if (!bool)
      {
        if (localb_1.d().l() < localb_2.d().l()) {
          return -1;
        }
        if (bool) {}
      }
      else if (localb_1.d().l() > localb_2.d().l())
      {
        return 1;
      }
      return 0;
    }
  }
  
  static class b_
    implements b.c_
  {
    private double b;
    private int e;
    private d f;
    
    public b_(double paramDouble, int paramInt, d paramd)
    {
      this.f = paramd;
      this.b = paramDouble;
      this.e = paramInt;
    }
    
    public double a()
    {
      return this.b;
    }
    
    public int c()
    {
      return this.e;
    }
    
    public d d()
    {
      return this.f;
    }
    
    public String toString()
    {
      if (!d.o) {
        if (this.e == 0) {
          return "S: " + this.b + " " + this.f;
        }
      }
      if (this.e == 1) {
        return "E: " + this.b + " " + this.f;
      }
      return null;
    }
  }
  
  static abstract interface c_
  {
    public static final int a = 0;
    public static final int c = 1;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.c.b

 * JD-Core Version:    0.7.0.1

 */